package com.czg.jsonschema2lombokpojo.model;

import com.fasterxml.jackson.databind.JsonNode;

public class EnumValueDefinition {
    private final String name;
    private final String value;
    private final String desc;
    private final JsonNode titleNode;
    private final JsonNode descriptionNode;
    private final JsonNode extensionNode;

    public EnumValueDefinition(String name, String value, String desc) {
        this(name, value, desc, null, null, null);
    }

    public EnumValueDefinition(String name, String value, String desc, JsonNode extensionNode) {
        this(name, value, desc, extensionNode, null, null);
    }

    public EnumValueDefinition(String name, String value, String desc, JsonNode extensionNode, JsonNode titleNode, JsonNode descriptionNode) {
        this.name = name;
        this.value = value;
        this.desc = desc;
        this.extensionNode = extensionNode;
        this.titleNode = titleNode;
        this.descriptionNode = descriptionNode;
    }

    public EnumValueDefinition(EnumValueDefinition enumValueDefinition) {
        this.name = enumValueDefinition.name;
        this.value = enumValueDefinition.value;
        this.desc = enumValueDefinition.desc;
        this.extensionNode = enumValueDefinition.extensionNode;
        this.titleNode = enumValueDefinition.titleNode;
        this.descriptionNode = enumValueDefinition.descriptionNode;
    }

    public JsonNode getDescriptionNode() {
        return descriptionNode;
    }

    public JsonNode getExtensionNode() {
        return extensionNode;
    }

    public String getName() {
        return name;
    }

    public JsonNode getTitleNode() {
        return titleNode;
    }

    public String getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public boolean hasDescription() {
        return descriptionNode != null && !descriptionNode.isMissingNode();
    }

    public boolean hasTitle() {
        return titleNode != null && !titleNode.isMissingNode();
    }
}
